package com.example1.hello;

import java.io.IOException;

import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebSettings.PluginState;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.VideoView;

public class MainActivity extends Activity {

	//Translator _Translator=new Translator();
	private Button _resButton;
	EditText _text;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.activity_main);
       
        
        _resButton = (Button) this.findViewById(R.id.button1);
        _text=(EditText)this.findViewById(R.id.editText1);
        _resButton.setOnClickListener(buttonListener);
        

         
        
        //
        
        
     
    }
    
    private OnClickListener buttonListener = new OnClickListener() {
    	  public void onClick(View view) 
    	  {
    		  Intent intent = new Intent(MainActivity.this, Translator_Service.class);
    		  startService(intent);
    		  
    		  
    		  
    	       /* new Thread(new Runnable() {
    	            
    	            public void run() {
    	            	String txt = _text.getText().toString();
    	            	//_Translator.speak(txt, "zh-tw");
    	            	
    	            	_Translator.Trans(txt,"en","zh-tw");
    	            	//tt.speak("hello test","ch");
    	                            }
    	        }).start();
    	        */
    	  }
     };


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
  
    
    

    
}
